local FLAC_PHILIA_COSTUME_SHOW_1_INDEX = GameInfo.Projects['PROJECT_FLAC_PHILIA_COSTUME_SHOW_1'].Index;
local FLAC_PHILIA_COSTUME_SHOW_2_INDEX = GameInfo.Projects['PROJECT_FLAC_PHILIA_COSTUME_SHOW_2'].Index;
local FLAC_PHILIA_COSTUME_SHOW_3_INDEX = GameInfo.Projects['PROJECT_FLAC_PHILIA_COSTUME_SHOW_3'].Index;
local FLAC_PHILIA_COSTUME_SHOW_4_INDEX = GameInfo.Projects['PROJECT_FLAC_PHILIA_COSTUME_SHOW_4'].Index;
local FLAC_PHILIA_COSTUME_SHOW_5_INDEX = GameInfo.Projects['PROJECT_FLAC_PHILIA_COSTUME_SHOW_5'].Index;
local FLAC_PHILIA_COSTUME_SHOW_6_INDEX = GameInfo.Projects['PROJECT_FLAC_PHILIA_COSTUME_SHOW_6'].Index;
local DESIGNER_INDEX = GameInfo.GreatPersonClasses["GREAT_PERSON_CLASS_DESIGNER"].Index;
local DESIGNER_1_INDEX = GameInfo.GreatPersonIndividuals['GREAT_PERSON_INDIVIDUAL_ION_OUKURA'].Index;
local DESIGNER_2_INDEX = GameInfo.GreatPersonIndividuals['GREAT_PERSON_INDIVIDUAL_RUNA_SAKURAKOUJI'].Index;
local DESIGNER_3_INDEX = GameInfo.GreatPersonIndividuals['GREAT_PERSON_INDIVIDUAL_URSULE_FLEUR_JEANMAIRE'].Index;
local DESIGNER_4_INDEX = GameInfo.GreatPersonIndividuals['GREAT_PERSON_INDIVIDUAL_MINATO_YANAGASE'].Index;
local DESIGNER_5_INDEX = GameInfo.GreatPersonIndividuals['GREAT_PERSON_INDIVIDUAL_MUZUHO_HANANOMIYA'].Index;
function AsahiCityProjectCompleted (playerId, cityId, projectId, buildngId, x, y, cancelled)
	local player = Players[playerId];
	if projectId == FLAC_PHILIA_COSTUME_SHOW_1_INDEX then
		Game.GetGreatPeople():GrantPerson(DESIGNER_1_INDEX, DESIGNER_INDEX, Game.GetEras():GetCurrentEra(), 0, player, false);
	elseif projectId == FLAC_PHILIA_COSTUME_SHOW_2_INDEX then
		Game.GetGreatPeople():GrantPerson(DESIGNER_2_INDEX, DESIGNER_INDEX, Game.GetEras():GetCurrentEra(), 0, player, false);
	elseif projectId == FLAC_PHILIA_COSTUME_SHOW_3_INDEX then
		Game.GetGreatPeople():GrantPerson(DESIGNER_3_INDEX, DESIGNER_INDEX, Game.GetEras():GetCurrentEra(), 0, player, false);
	elseif projectId == FLAC_PHILIA_COSTUME_SHOW_4_INDEX then
		Game.GetGreatPeople():GrantPerson(DESIGNER_4_INDEX, DESIGNER_INDEX, Game.GetEras():GetCurrentEra(), 0, player, false);
	elseif projectId == FLAC_PHILIA_COSTUME_SHOW_5_INDEX then
		Game.GetGreatPeople():GrantPerson(DESIGNER_5_INDEX, DESIGNER_INDEX, Game.GetEras():GetCurrentEra(), 0, player, false);
	elseif projectId == FLAC_PHILIA_COSTUME_SHOW_6_INDEX then

	end
end
Events.CityProjectCompleted.Add(AsahiCityProjectCompleted);

GameEvents.AsahiImprovementSwitch.Add(function (playerId, plotIndex, improvementIndex)
	local plot = Map.GetPlotByIndex(plotIndex);
	ImprovementBuilder.SetImprovementType(plot, improvementIndex, playerId);
end);

local URSULE_FLEUR_JEANMAIRE_INDEX = GameInfo.GreatPersonIndividuals['GREAT_PERSON_INDIVIDUAL_URSULE_FLEUR_JEANMAIRE'].Index;
local HOSPITAL = GameInfo.Improvements['BUILDING_JNR_HOSPITAL'];
function AsahiGreatPersonHandleActivation (playerId, unitId, greatPersonIndividualId)
	if greatPersonIndividualId == URSULE_FLEUR_JEANMAIRE_INDEX then
		local player = Players[playerId];
		local unit = UnitManager.GetUnit(playerId, unitId);
		local unitPlot = Map.GetPlot(unit:GetX(), unit:GetY());
		local districtAtPlot = CityManager.GetDistrictAt(unitPlot);
		if districtAtPlot ~= nil then
			local city = districtAtPlot:GetCity();
			local population = city:GetPopulation();
			local rate = 100;
			if (HOSPITAL ~= nil) and city:GetBuildings():HasBuilding(HOSPITAL.Index) then
				rate = 200;
			end
			local amount = population * rate;
			player:GetTechs():ChangeCurrentResearchProgress(amount);
			player:GetTreasury():ChangeGoldBalance(amount);
			Game.AddWorldViewText(0, "+" .. amount .. " [ICON_SCIENCE]", unit:GetX(), unit:GetY());
			Game.AddWorldViewText(0, "+" .. amount .. " [ICON_GOLD]", unit:GetX(), unit:GetY());
		end
	end
end
GameEvents.GreatPersonHandleActivation.Add(AsahiGreatPersonHandleActivation);